<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--       
*     Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
*     Use is subject to license terms.
-->
<html>
<head>
<title>Managing the Classpath of JavaFX Projects</title>
	<link rel="StyleSheet" href="nbdocs://org.netbeans.modules.usersguide/org/netbeans/modules/usersguide/ide.css" type="text/css">
</head>
<body>
<h2>Managing the Classpath of JavaFX Projects</h2>
<p> <small><a href="#seealso">See Also</a>&nbsp; </small> 
<p>Adding a group of class files to a JavaFX project's classpath tells the IDE which 
  classes the project should have access to during compilation and execution. 
  The IDE also uses classpath settings to enable code completion, automatic highlighting 
  of compilation errors, and refactoring. 
<ul class="note">
	<li>Source roots must only exist in a single project  and
		cannot be shared with other projects, regardless of whether they are opened
		or not. If you need to use a library in several projects, create a special
		project within which to store it.
</ul>

<h3> Classpath and JavaFX Projects</h3>
<!--todo : add mention of libraries node here & mention contextual menu as primary way to add items to classpath (for more detailed configing, use proj props)-->
<p>The IDE maintains separate classpaths for compiling and running your 
JavaFX project. The IDE automatically adds 
everything on your project's compilation classpath to the project's runtime classpath.</p>

        <ul class="note">
        <li>Whenever you build a JavaFX project for which a main class is specified, the IDE automatically copies any JAR 
        files on the project's classpath to the <tt>dist/lib</tt> folder.
        The IDE also adds each of the JAR files 
        to the Class-Path element in the application JAR's <tt>manifest.mf</tt> 
        file. This simplifies running the application outside the IDE.</li>
        </ul>  

<p><b>To edit a JavaFX project's classpath:</b></p>
<ol>
  <li>Expand the project node, right-click the Libraries node, and choose Properties.<br>
    Alternatively, you can select the project in the Projects window, select File &gt; Project Properties (<i>&lt;JavaFX_project_name&gt;) </i>from the main menu, and select the Libraries category from the Project Properties dialog. </li>
    <li>In the Project Properties dialog box, add the necessary elements to the project's compilation classpath by clicking
  	the appropriate Add button. You can add any of the following:
	  <ul><li><b>Project.</b> The JAR file or
      	WAR file produced by another project, as well as the associated source
      	files and Javadoc documentation.</li>
      <li><b>Library.</b> A collection of JAR 
        files or folders with compiled classes, which can optionally have associated 
        source files and Javadoc documentation.</li>
	<li><b>JAR/Folder.</b> A JAR file or folder that contains compiled classes.</li>
    </ul>
   </li>
  <li>(Optional) Click the Build Projects on Classpath checkbox if you do not want to
 rebuild all projects on the classpath whenever you build the current project. By default, all projects on the classpath and, in
 web applications, projects listed in the Packaging page, are rebuilt when you build the current project.</li>
  <li>(Optional) Click the Move Up and Move Down buttons to alter the
   classpath priority.</li>
  <li>(Optional) Click the Run, Compile Tests, or Run Tests tabs to make any
  	changes to the these classpaths.</li>
</ol>

<ul class="note">
  <li>You can also add dependent projects and other required resources to a project by simply right-clicking the 
   Libraries node in the Projects window and choosing the appropriate item (Add Project, Add Library, or Add JAR/Folder) from the contextual menu.
</ul>
     
        
<dl>
    <dt><a name="seealso">See also</a></dt>
	<dd><a href="../project/javafx_proj_sdk.html">Setting the Target JavaFX SDK in a JavaFX Project </a></dd>
    <dd><a href="../run/javafx_run_args.html">Setting the Main JavaFX Class and Runtime Arguments</a></dd>        
</dl>
<hr>
<small><a href="../credits.html">Legal Notices</a></small> 

<table border="0" cellpadding="20">
<tr><td>&nbsp;</td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td>&nbsp;</td></tr>
</table></body>
</html>
